/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mad.bikepony.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.mad.bikepony.model.Agent;

import java.io.Serializable;

/**
 * The cache model class for representing Agent in entity cache.
 *
 * @author nicola
 * @see Agent
 * @generated
 */
public class AgentCacheModel implements CacheModel<Agent>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(19);

		sb.append("{agentId=");
		sb.append(agentId);
		sb.append(", password=");
		sb.append(password);
		sb.append(", name=");
		sb.append(name);
		sb.append(", surname=");
		sb.append(surname);
		sb.append(", mobilePhone=");
		sb.append(mobilePhone);
		sb.append(", status=");
		sb.append(status);
		sb.append(", lastPos_latitude=");
		sb.append(lastPos_latitude);
		sb.append(", lastPos_longitude=");
		sb.append(lastPos_longitude);
		sb.append(", lastUpdate=");
		sb.append(lastUpdate);
		sb.append("}");

		return sb.toString();
	}

	public Agent toEntityModel() {
		AgentImpl agentImpl = new AgentImpl();

		agentImpl.setAgentId(agentId);

		if (password == null) {
			agentImpl.setPassword(StringPool.BLANK);
		}
		else {
			agentImpl.setPassword(password);
		}

		if (name == null) {
			agentImpl.setName(StringPool.BLANK);
		}
		else {
			agentImpl.setName(name);
		}

		if (surname == null) {
			agentImpl.setSurname(StringPool.BLANK);
		}
		else {
			agentImpl.setSurname(surname);
		}

		if (mobilePhone == null) {
			agentImpl.setMobilePhone(StringPool.BLANK);
		}
		else {
			agentImpl.setMobilePhone(mobilePhone);
		}

		agentImpl.setStatus(status);
		agentImpl.setLastPos_latitude(lastPos_latitude);
		agentImpl.setLastPos_longitude(lastPos_longitude);
		agentImpl.setLastUpdate(lastUpdate);

		agentImpl.resetOriginalValues();

		return agentImpl;
	}

	public long agentId;
	public String password;
	public String name;
	public String surname;
	public String mobilePhone;
	public int status;
	public double lastPos_latitude;
	public double lastPos_longitude;
	public long lastUpdate;
}